import React, { Component } from 'react'
import './Item.css'
export default class Item extends Component {
  render() {
    // const { todoName } = this.props.todo
    // 先解构props里面的todo,然后直接在后面结构todo里面的todoName
    const {
      todo: { todoName, isDone },
    } = this.props

    return (
      <li>
        <label>
          <input type="checkbox" checked={isDone} onChange={() => {}} />
          <span className={isDone ? 'active' : ''}>{todoName}</span>
        </label>
        <button className="btn btn-danger">删除</button>
      </li>
    )
  }
}
